A device that provides content for visual presentation generally includes a GPU. The GPU renders pixels that are representative of the content on a display. The GPU generates one or more pixel values for each pixel on the display and performs graphics processing on the pixel values for each pixel on the display to render each pixel for presentation. The rendering process may include execution of one or more shader programs, which may modify the pixel values.
Programmers typically utilize high-level coding languages that are understandable to human users to develop software, that is, a set of instructions for a computer. Such instructions are typically compiled, that is, converted from the high-level coding language to low-level object code (sometimes referred to as machine code), which can be executed by a processor, e.g., a general purpose processor or a graphics processing unit (GPU). Compilation can be performed prior to execution or at the time of execution, sometimes referred to as “just-in-time” compilation. For example, shader programs for GPUs are often compiled just-in-time.
Compilers may be configured to perform various optimization tasks. Such optimizations may include attempting to reduce memory consumed during execution of the compiled code, to increase speed at which the compiled code can be executed, and the like. Some code optimization problems have been shown to be nondeterministic polynomial time (NP)-complete, or even undecidable. Accordingly, code optimization processes can take a relatively long amount of time to perform, and can be both processor- and memory-intensive.